package com.zhuyp.shiro.controller;


import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("shiro")
public class ShiroController {
	
	@RequestMapping("common")
	@ResponseBody
	public String common() {
		return"common";
	}
	
	@RequestMapping("admin")
	@ResponseBody
	@RequiresRoles("admin")
	public String admin() {
		return"admin";
	}
	
	@RequestMapping("guest")
	@ResponseBody
	@RequiresRoles("guest")
	public String guest() {
		return"guest";
	}

}
